import service from "@/api/index.js"
import {createRouterMatcher as Promise} from "vue-router";

const goodsApi={
    insert(goods){
        return service.post("/goods",goods);
    },
    delete(id){
        return service.delete(`/goods/${id}`);
    },
    update(goods) {
        return service.put("/goods",goods);
    },
    selectById(id) {
        return service.get(`/goods/${id}`);
    },
    selectByPage(condition, pageNum, pageSize) {
        condition.pageNum = pageNum;
        condition.pageSize= pageSize;
        return service.get("/goods",{
            params:condition
        });
    },
    selectByPage1(condition, pageNum, pageSize) {
        condition.pageNum = pageNum;
        condition.pageSize= pageSize;
        return service.get("/goods/search",{
            params:condition
        });
    },
    selectByGroupByCategory() {
        return service.get("/goods/selectByGroupByCategory")
    },
    all() {
        return service.get("/goods/all")
    }
};
export default goodsApi